package cn.edu.nit.sys.service.impl;

import cn.edu.nit.sys.entity.SysLog;
import cn.edu.nit.sys.mapper.SysLogMapper;
import cn.edu.nit.sys.service.SysLogService;
import cn.edu.nit.sys.utils.R;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

/**
 * @Author xiaobai
 * @Date 2022/8/30 19:32
 * @Version 1.0.0
 */
@Service
public class SysLogServiceImpl extends ServiceImpl<SysLogMapper, SysLog> implements SysLogService {

    @Override
    public R getList(Page<SysLog> page) {
        Page<SysLog> list = baseMapper.getList(page);
        JSONObject jsonObject = new JSONObject();
        jsonObject.put("total", list.getTotal());
        jsonObject.put("list", list.getRecords());
        return R.ok(jsonObject);
    }
}
